// LabelTable.h: interface for the CLabelTable class.
//
//////////////////////////////////////////////////////////////////////

#if !defined(AFX_LABELTABLE_H__DC7EE443_7A09_11D2_8064_00A0C91F41A7__INCLUDED_)
#define AFX_LABELTABLE_H__DC7EE443_7A09_11D2_8064_00A0C91F41A7__INCLUDED_

#if _MSC_VER >= 1000
#pragma once
#endif // _MSC_VER >= 1000

#define MAX_LABELS 1024

//#include <afxtempl.h>
#include "MyTypedef.h"

class CLabelTable  
{
public:
	CLabelTable();
	virtual ~CLabelTable();
    
    //Implementation
public:
    int Search(char *);
    inline int GetLastSuccessfulLookup()    { return m_nLastLookedUp; }
    // returns 0 if not successful 
    int Add(char * label,int address);

public:
	void Reset();
    static int nCount;
protected:
    //CMap<char *,char *,int,int &> m_LabelTable;
#define TABLE_SIZE	1024
    char *m_szLabel[TABLE_SIZE];	// the label
    word m_nAddress[TABLE_SIZE];	// the memory address where it points to
	int  m_nSourceLine[TABLE_SIZE]; //
    int  m_nCount; // number of elements

    // the result of the last successful lookup
    int m_nLastLookedUp;
};

#endif // !defined(AFX_LABELTABLE_H__DC7EE443_7A09_11D2_8064_00A0C91F41A7__INCLUDED_)
